package com.zqxq.lottery.entity.o2o.news;

import com.zqxq.common.utils.DateUtils;
import com.zqxq.lottery.entity.po.news.MatchNewsLikesPO;
import com.zqxq.lottery.entity.po.news.MatchNewsPO;
import com.zqxq.lottery.entity.vo.news.MatchNewsLikesVO;
import com.zqxq.lottery.entity.vo.news.MatchNewsVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 苦智
 * @date 2018/9/5 10:56
 * @description
 * @ClassName MatchNewsO2O
 */
public class MatchNewsLikesO2O {
    public static MatchNewsLikesVO toVO(MatchNewsLikesPO matchNewsLikesPO) {
        if (matchNewsLikesPO == null) {
            return null;
        }
        MatchNewsLikesVO matchNewsVO = new MatchNewsLikesVO();
        matchNewsVO.setLikesId(matchNewsLikesPO.getId().toString());
        matchNewsVO.setNewsId(matchNewsLikesPO.getNews_id().toString());
        matchNewsVO.setUserId(matchNewsLikesPO.getUser_id().toString());
        matchNewsVO.setPayAmount(matchNewsLikesPO.getPay_amount().toString());
        matchNewsVO.setStatus(matchNewsLikesPO.getStatus());
        return matchNewsVO;
    }

    public static List<MatchNewsLikesVO> toVOList(List<MatchNewsLikesPO> list){
         List<MatchNewsLikesVO> result = new ArrayList<>();
         if (list != null && list.size() > 0){
             for (MatchNewsLikesPO po : list) {
                 result.add(toVO(po));
             }
         }
         return result;
    }
}
